package com.cssy.xxkj.logic.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.byd.acegiext.domain.User;
import com.cssy.xxkj.logic.dao.LogicPurchaseWareItemDAO;
import com.cssy.xxkj.logic.entity.LogicPurchaseWareItemDO;
import com.cssy.xxkj.logic.service.ILogicPurchaseWareItemService;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchConditions;
import com.plat.helper.SearchResult;

@Service("logicPurchaseWareItemService")
public class LogicPurchaseWareItemServiceImpl implements
		ILogicPurchaseWareItemService {

	@Resource(name = "logicPurchaseWareItemDAO")
	private LogicPurchaseWareItemDAO logicPurchaseWareItemDAO;
	
	@Override
	public SearchResult findListByExample(SearchConditions scs)
			throws SyBaseException {
		SearchResult rs = new SearchResult(scs);
		List<LogicPurchaseWareItemDO> list = logicPurchaseWareItemDAO.find(scs);
		rs.setRecordCount(logicPurchaseWareItemDAO.count(scs));
		rs.setResults(list);
		return rs;
	}
	
	@Override
	public List<LogicPurchaseWareItemDO> findListByMap(Map<String, Object> paramMap)
			throws SyBaseException{
		return logicPurchaseWareItemDAO.findListByMap(paramMap);
	}
	

	@Override
	public Integer delete(String id, User user) throws SyBaseException {
		return logicPurchaseWareItemDAO.deleteLogicPurchaseWareItemDOByPrimaryKey(id);
	}

	@Override
	public Integer update(LogicPurchaseWareItemDO pcsm, User user)
			throws SyBaseException {
		return logicPurchaseWareItemDAO.updateLogicPurchaseWareItemDO(pcsm);
	}

	@Override
	public LogicPurchaseWareItemDO save(LogicPurchaseWareItemDO pcswm, User user)
			throws SyBaseException {
		logicPurchaseWareItemDAO.insertLogicPurchaseWareItemDO(pcswm);
		return pcswm;
	}

	@Override
	public LogicPurchaseWareItemDO findListById(String id)
			throws SyBaseException {
		return logicPurchaseWareItemDAO.findLogicPurchaseWareItemDOByPrimaryKey(id);
	}

	@Override
	public Integer deleteBizRemoved(String id) throws SyBaseException {
		// TODO Auto-generated method stub
		return null;
	}

}
